#include <ros/ros.h>
#include "robot_audio/Mode.h"
#include "robot_audio/IAT.h"
ros::ServiceClient iat_client;
bool mode_cb(robot_audio::Mode::Request &req, robot_audio::Mode::Response &res){
	std::cout <<"==" << req.mode_order << "==" <<std::endl;
	if(req.mode_order.find("聊天模式") != std::string::npos){
		res.mode= "聊天模式";
	}
	else if(req.mode_order.find("控制模式") != std::string::npos){
		res.mode= "控制模式";
	}
	else if(req.mode_order.find("导航模式") != std::string::npos){
		res.mode= "导航模式";
	}
	else res.mode= "未知模式";
	std::cout<<"mode:"<<res.mode<<std::endl;
	return true;
}

int main(int argc, char* argv[])
{
	/*初始化ros节点*/
	ros::init(argc, argv, "voice_mode");
	/*定义节点句柄*/
	ros::NodeHandle nh;

	ros::ServiceServer mode_server = nh.advertiseService("voice_mode", mode_cb);        
    
	ros::spin();

	return 0;
}
